#include "sort.h"
#include "str.h"

void heapSort(char** words, int arraySize)
{
   int i = 0;

   int heapSize = arraySize;

	for(i = arraySize/2; i >= 0; i--)
	{
		maxHeapify(words, i, heapSize);
	}

	for( i = arraySize-1; i >= 1; i--)
	{
		swap(&words[0],&words[i]);
		heapSize = heapSize -1;
		maxHeapify(words, 0, heapSize);
	}
}
